package cn.bookshare.order.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import cn.bookshare.order.dao.OrderDao;
import cn.bookshare.order.vo.Order;
import cn.bookshare.user.dao.UserDao;
/**
 * 订单模块业务层代码
 * @author Lijt
 * @version 2017-2-23 下午2:43:05
 */
@Transactional
public class OrderService {
	//注入OrdersDao
	private OrderDao ordersDao;
	
	public void setOrdersDao(OrderDao ordersDao) {
		this.ordersDao = ordersDao;
	}
	
	//订单保存
	public void save(Order order) {
		this.ordersDao.save(order);
	}

	//根据借出者查询订单
	public List<Order> findOrderByFuid(Integer fuid) {
		return this.ordersDao.findOrderByFuid(fuid);
	}

	//根据借书者查询订单
	public List<Order> findOrderByTuid(Integer tuid) {
		return this.ordersDao.findOrderByTuid(tuid);
	}
	
	//查询自己当前订单
	public List<Order> findOrderById(Integer id) {
		return this.ordersDao.findOrderById(id);
	}
}
